/**
 * 2010(c) Copyright Oceansoft Information System Co.,LTD. All rights reserved.
 * <p>
 * Compile: JDK 1.6+
 * <p>
 * 版权所有(C)：江苏欧索软件有限公司
 * <p>
 * 公司名称：江苏欧索软件有限公司
 * <p>
 * 公司地址：中国苏州科技城青山路1号
 * <p>
 * 网址: http://www.oceansoft.com.cn
 * <p>
 * 版本: 苏州公安统一用户管理平台1.0
 * <p>
 * 作者: 090922(陈伟)
 * <p>
 * 文件名:SysUserMapper.java
 * <p>
 * 类产生时间: 2012-6-11 上午11:39:47
 * <p>
 * 负责人: 090922(陈伟)
 * <p>
 * Email:javacspring@gmail.com
 * <p>
 * 所在组 : 苏州公安统一用户管理平台
 * <p>
 * 所在部门: 电信/国土——技术二部
 * <p>
 * <p>
 */
package com.oceansoft.core.dao.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.oceansoft.core.domain.SysDept;
import com.oceansoft.core.domain.SysUser;

/**
 * 系统用户结果集封装
 * 
 * @author chenw
 * 
 */
public class SysUserMapper implements RowMapper<SysUser> {
	private boolean isSyncData = false;

	@Override
	public SysUser mapRow(ResultSet rs, int index) throws SQLException {
		SysUser sysUser = new SysUser();
		SysDept sysDept = new SysDept();
		sysUser.setName(rs.getString("NAME"));
		sysUser.setPoliceNum(rs.getString("POLICENUM"));
		sysUser.setIdCard(rs.getString("IDCARD"));
		sysUser.setDeptId(rs.getString("DEPTID"));
		sysUser.setDutyName(rs.getString("DUTYNAME"));
		sysUser.setActiveFlag(rs.getString("ACTIVEFLAG"));
		sysUser.setTel_mobile(rs.getString("tel_mobile"));
		sysUser.setOrderNum(new Integer(rs.getInt("orderNum")));
		sysUser.setDbId(rs.getLong("DBID"));
		sysUser.setDeptName(rs.getString("DEPTNAME"));
		sysUser.setPassword(rs.getString("PASSWORD"));
		sysUser.setPhoto(rs.getString("PHOTO"));
		//sysUser.setBirthday(rs.getString("BIRTHDAY"));
		sysUser.setRemark(rs.getString("REMARK"));
		sysDept.setName(rs.getString("DEPTNAME"));
		//sysDept.setDeep(rs.getInt("DEEP"));
		
//		sysUser.setSysDept(sysDept);
		return sysUser;
	}

	public boolean isSyncData() {
		return isSyncData;
	}

	public void setSyncData(boolean isSyncData) {
		this.isSyncData = isSyncData;
	}

	public SysUserMapper(boolean isSyncData) {
		super();
		this.isSyncData = isSyncData;
	}

	public SysUserMapper() {
		super();
	}
}
